/* $Id: ClientDomainObjectManager.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.domain.manager;

import java.util.List;

import ae.pcfc.etks.online.common.domain.Client;
import ae.pcfc.etks.online.common.domain.ClientRoleReq;
import ae.pcfc.etks.online.common.domain.ClientServiceRole;
import ae.pcfc.etks.online.common.exception.LookupException;
import ae.pcfc.etks.online.common.exception.PersistenceException;
import ae.pcfc.etks.online.common.vo.TrakheesIdVO;

public interface ClientDomainObjectManager extends BaseDomainObjectManager {
	
	/**
	 * getClientByApplicationId
	 * Method to find the client by application id
	 * @param applicationId
	 * @return
	 * @throws LookupException
	 * Client
	 */
	public Client getClientByApplicationId(String applicationId) throws LookupException;
	
	/**
	 * findClientByUserName
	 * Method to find the client by the user registered under it
	 * @param userName
	 * @return
	 * @throws LookupException
	 * Client
	 */
	public Client findClientByUserName(String userName) throws LookupException;
	
	/**
	 * findTrakheesIdByUserName
	 * Method to find the trakhees id of a client by the user registered under it
	 * @param userName
	 * @return
	 * @throws LookupException
	 * String
	 */
	public String findTrakheesIdByUserName(String userName) throws LookupException;
	
	/*public User userValidation(String userName, String password);*/
	
	/**
	 * addClientRoleReq
	 * Method to add client role request
	 * @param clientRoleReq
	 * @throws PersistenceException
	 * void
	 */
	public void addClientRoleReq(ClientRoleReq clientRoleReq) throws PersistenceException;
	
	/**
	 * findClientRolReqByApplicationId
	 * Method to find the client role requests by application id
	 * @param applicationId
	 * @return
	 * @throws LookupException
	 * List<ClientRoleReq>
	 */
	public List<ClientRoleReq> findClientRolReqByApplicationId(String applicationId) throws LookupException; 
	
	/**
	 * addClientServiceRole
	 * Method to add client service role
	 * @param clientServiceRole
	 * @throws PersistenceException
	 * void
	 */
	public void addClientServiceRole(ClientServiceRole clientServiceRole) throws PersistenceException;
	
	/**
	 * findClientUserByEmail
	 * Method to find the client by the email of the user registered under it
	 * @param email
	 * @return
	 * @throws LookupException
	 * Client
	 */
	public Client findClientUserByEmail(String email) throws LookupException;
	
	/**
	 * findByTrakheesIds
	 * Method to find the clients by trakhees ids
	 * @param trakheesIdVOs
	 * @return
	 * @throws LookupException
	 * List<Client>
	 */
	public List<Client> findByTrakheesIds(List<TrakheesIdVO> trakheesIdVOs) throws LookupException;
	
	/**
	 * findByTrakheesId
	 * Method to find client by trakhees id
	 * @param trakheesId
	 * @return
	 * @throws LookupException
	 * Client
	 */
	public Client findByTrakheesId(String trakheesId) throws LookupException;
	
	/**
	 * findClientRoleReqByClientAndRoleId
	 * Method to find the client roles by client id and role id
	 * @param clientId
	 * @param roleId
	 * @return
	 * @throws LookupException
	 * ClientRoleReq
	 */
	public ClientRoleReq findClientRoleReqByClientAndRoleId(Long clientId, Long roleId) throws LookupException;
	
	/**
	 * findClientRoleReqByTrakheesId
	 * Method to find the client role requests of a client (trakhees id)
	 * @param trakheesId
	 * @return
	 * @throws LookupException
	 * List<ClientRoleReq>
	 */
	public List<ClientRoleReq> findClientRoleReqByTrakheesId(String trakheesId) throws LookupException;

	/**
	 * findClientServiceRole
	 * Method to find the client service roles by searching with a client service role object which contains the fields for filtering
	 * @param clientServiceRole
	 * @return
	 * List<ClientServiceRole>
	 */
	public List<ClientServiceRole> findClientServiceRole(ClientServiceRole clientServiceRole);
	
}
